Optimal. Leaf size=68 \[ -\frac{a (B+i A) \cot (c+d x)}{d}-\frac{a (A-i B) \log (\sin (c+d x))}{d}-a x (B+i A)-\frac{a A \cot ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.121235, antiderivative size = 68, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3591, 3529, 3531, 3475} \[ -\frac{a (B+i A) \cot (c+d x)}{d}-\frac{a (A-i B) \log (\sin (c+d x))}{d}-a x (B+i A)-\frac{a A \cot ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3591
Rule 3529
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \cot ^3(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=-\frac{a A \cot ^2(c+d x)}{2 d}+\int \cot ^2(c+d x) (a (i A+B)-a (A-i B) \tan (c+d x)) \, dx\\ &=-\frac{a (i A+B) \cot (c+d x)}{d}-\frac{a A \cot ^2(c+d x)}{2 d}+\int \cot (c+d x) (-a (A-i B)-a (i A+B) \tan (c+d x)) \, dx\\ &=-a (i A+B) x-\frac{a (i A+B) \cot (c+d x)}{d}-\frac{a A \cot ^2(c+d x)}{2 d}-(a (A-i B)) \int \cot (c+d x) \, dx\\ &=-a (i A+B) x-\frac{a (i A+B) \cot (c+d x)}{d}-\frac{a A \cot ^2(c+d x)}{2 d}-\frac{a (A-i B) \log (\sin (c+d x))}{d}\\ \end{align*}
Mathematica [C] time = 0.361013, size = 76, normalized size = 1.12 \[ -\frac{a \left (2 (B+i A) \cot (c+d x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(c+d x)\right )+2 (A-i B) (\log (\tan (c+d x))+\log (\cos (c+d x)))+A \cot ^2(c+d x)\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.064, size = 101, normalized size = 1.5 \begin{align*} -iAax-{\frac{iA\cot \left ( dx+c \right ) a}{d}}-{\frac{iAac}{d}}+{\frac{iBa\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-{\frac{Aa \left ( \cot \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{Aa\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}-aBx-{\frac{\cot \left ( dx+c \right ) Ba}{d}}-{\frac{Bac}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.70647, size = 113, normalized size = 1.66 \begin{align*} \frac{2 \,{\left (d x + c\right )}{\left (-i \, A - B\right )} a +{\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \,{\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )\right ) + \frac{2 \,{\left (-i \, A - B\right )} a \tan \left (d x + c\right ) - A a}{\tan \left (d x + c\right )^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.40163, size = 302, normalized size = 4.44 \begin{align*} \frac{2 \,{\left (2 \, A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \,{\left (A - i \, B\right )} a -{\left ({\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \,{\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 5.83582, size = 109, normalized size = 1.6 \begin{align*} \frac{a \left (- A + i B\right ) \log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac{- \frac{\left (2 A a - 2 i B a\right ) e^{- 4 i c}}{d} + \frac{\left (4 A a - 2 i B a\right ) e^{- 2 i c} e^{2 i d x}}{d}}{e^{4 i d x} - 2 e^{- 2 i c} e^{2 i d x} + e^{- 4 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.45869, size = 220, normalized size = 3.24 \begin{align*} -\frac{A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 4 i \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 16 \,{\left (A a - i \, B a\right )} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) + 8 \,{\left (A a - i \, B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - \frac{12 \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 i \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 4 i \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - A a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2}}}{8 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]